
import logging
from redis import StrictRedis
from datetime import timedelta

class Config(object):
    DEBUG = True
    # 设置密钥
    SECRET_KEY = "b'XO~\x81\x06\xe1\xac\xee\xe9\x1c$&e\xa7'\n\x1e\xee\x8c\x02\xe4h\x17\xe1\x90\xd3\x99\xf2h\xd1\xf2\x82'"

    # Redis配置
    REDIS_HOST = 'localhost'
    REDIS_PORT = 6379
    # REDIS_PASSWORD = ''

    # 配置session缓存
    SESSION_TYPE = 'redis'
    SESSION_USE_SIGNER = True
    SESSION_REDIS = StrictRedis()
    PERMANENT_SESSION_LIFETIME = timedelta(days=2)

    # 数据库配置
    DATABASE = 'lovehome'
    DATABASE_HOST = 'root'
    DATABASE_PASSWORD = 'mysql'
    DATABASE_PORT = 3306
    SQLALCHEMY_DATABASE_URI = "mysql://{}:{}@localhost:{}/{}".format(DATABASE_HOST, DATABASE_PASSWORD,
                                                                             DATABASE_PORT, DATABASE)
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    LEVEL_NAME = logging.DEBUG
    # 配置分页数据量
    PRE_PAGE = 10

# 日志配置
